<template>
	<view :style="item.compStyle" :class="item.compClass">
		<titleBettweenAndContent 
		:config="getTitleConfig"
		@click="$emit('click', getTitleConfig)">
			<view slot="content">
				<image src="" mode="aspectFill" class="top-image"></image>
				<scroll-view scroll-x="true" class="scroll-view">
					<view class="white-space_nowrap">
						<view class="scroll-view_x-item pre-hover" hover-class="hover" v-for="(item, index) in getList" :key="index" @tap.stop="$emit('click', item)">
							<view class="scroll-view_x-item-box">
								<image src="" mode="aspectFill" class="scroll-view-image"></image>
								<text class="product-name">这是一条标题这是一条标题这是一条标题</text>
								<view class="product-bot-box">
									<text class="price price-weight">￥600</text>
									<!-- <image src="/static/image/cart.png" mode="aspectFill" class="dyc-img-cart"></image> -->
									<text class="through-price">￥800</text>
								</view>
							</view>
						</view>
					</view>
				</scroll-view>
			</view>
		</titleBettweenAndContent>
		<!-- <view style="height: 30rpx;"></view> -->
	</view>
</template>

<script>
	import titleBettweenAndContent from '../titleBettweenAndContent/titleBettweenAndContent.vue';
	import QSSuperComponentCustomCompMixin from '../QSSuperComponentCustomCompMixin.js'
	export default {
		mixins: [QSSuperComponentCustomCompMixin({componentType:'bargainBuy-1'})],
		components: { titleBettweenAndContent },
		props: {
			item: {
				type: Object,
				default: ()=>({})
			}
		},
		computed: {
			getTitleConfig() {
				const o = this.item?.attributes?.titleConfig || {};
				
				return { fontSize: '38rpx' , ...o};
			},
			getList() {
				return this.item?.attributes?.list || [];
			}
		}
	}
</script>

<style scoped>
	.top-image{
		display: block;
		width: 100%;
		height: 200rpx;
		background-color: #F2F2F2;
	}
	.product-name{
		width:210rpx;
		white-space: nowrap;
		text-overflow: ellipsis;
		overflow: hidden;
		font-size: 30rpx;
		margin-bottom: 24rpx;
	}
	.scroll-view{
		height: 404rpx;
		padding-top: 25rpx;
		display: flex;
		flex-direction: row;
		white-space: nowrap;
		overflow: hidden;
	}
	.scroll-view_x{
		position: relative;
		display: flex;
		flex-direction: row;
		padding-left: 25rpx;
		padding-right: 25rpx;
		white-space: nowrap;
		overflow: hidden;
	}
	.scroll-view_x-item{
		display: inline-block;
		position: relative;
		border-radius: 8rpx;
		overflow: hidden;
		margin-right: 20rpx;
	}
	.scroll-view_x-item:nth-child(1) {
		margin-left: 25rpx;
	}
	.scroll-view_x-item:nth-last-child(1) {
		margin-right: 25rpx;
	}
	.scroll-view_x-item-box{
		display: flex;
		flex-direction: column;
	}
	.scroll-view-image{
		height: 210rpx;
		width: 210rpx;
		margin-bottom: 24rpx;
		background-color: #F2F2F2;
	}
	.product-bot-box{
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}
	
	.price{
		font-size: 32rpx;
		color: #F52F50;
	}
	.through-price {
		font-size: 24rpx;
		color: #BBBBBB;
		text-decoration: line-through;
	}
</style>
